﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="clr-namespace:Peter.Common.Controls"
                    xmlns:icons="clr-namespace:Peter.Common.Icons">

   <Style TargetType="{x:Type controls:StatusIcon}">
      <Setter Property="FontSize"
              Value="18" />
      <Setter Property="Template">
         <Setter.Value>
            <ControlTemplate TargetType="{x:Type controls:StatusIcon}">
               <Border Padding="{TemplateBinding Padding}"
                       Margin="{TemplateBinding Margin}"
                       Background="{TemplateBinding Background}"
                       BorderBrush="{TemplateBinding BorderBrush}"
                       BorderThickness="{TemplateBinding BorderThickness}"
                       VerticalAlignment="{TemplateBinding VerticalAlignment}"
                       HorizontalAlignment="{TemplateBinding HorizontalAlignment}">
                  <icons:IconDisplay Icon="None"
                                     x:Name="GlyphDisplay"
                                     Foreground="{TemplateBinding Foreground}" />
               </Border>
               <ControlTemplate.Triggers>
                  <Trigger Property="Status"
                           Value="Bad">
                     <Setter Property="Foreground"
                             Value="{DynamicResource ErrorBrush}" />
                     <Setter TargetName="GlyphDisplay"
                             Property="Icon"
                             Value="WarningSign" />
                  </Trigger>

                  <Trigger Property="Status"
                           Value="Warn">
                     <Setter Property="Foreground"
                             Value="{DynamicResource WarningBrush}" />
                     <Setter TargetName="GlyphDisplay"
                             Property="Icon"
                             Value="ExclamationSign" />
                  </Trigger>

                  <Trigger Property="Status"
                           Value="Good">
                     <Setter Property="Foreground"
                             Value="{DynamicResource AllGoodBrush}" />
                     <Setter TargetName="GlyphDisplay"
                             Property="Icon"
                             Value="Ok" />
                  </Trigger>

                  <Trigger Property="Status"
                           Value="Info">
                     <Setter Property="Foreground"
                             Value="{DynamicResource InfoBrush}" />
                     <Setter TargetName="GlyphDisplay"
                             Property="Icon"
                             Value="InfoSign" />
                  </Trigger>
               </ControlTemplate.Triggers>

            </ControlTemplate>
         </Setter.Value>
      </Setter>
   </Style>

</ResourceDictionary>